#ifndef RECTANGLETRACK_H
#define RECTANGLETRACK_H

#include "mil.h"

class CRectangleTrack
{
public:
	CRectangleTrack() ;

	CRect GetRect() ;

	int m_nProcess ;

	void SetRect(CRect rect) ;
	void SetColor(COLORREF color) ;
	void SetWnd(CWnd* pWnd) ;

	void ShowNEW(CDC *pDC, int xOffset, int yOffset) ;
	void HideOLD(CDC *pDC, int xOffset, int yOffset) ;

	void DrawProcess(CDC *pDC, int left, int top, int right, int bottom) ;

	void OnMouseMove(UINT nFlags, CPoint point) ;
	void OnLButtonDown(UINT nFlags, CPoint point) ;
	void OnLButtonUp(UINT nFlags, CPoint point) ;

	void Reset() ;

	int GetChoNum(){return m_nChoNum;}

private :
	CWnd* m_pWnd ;

	CRect m_rect ; 
	CRect m_oldRect ;
	CRect m_oldRectDirect[9] ;

	CPoint m_OldPoint;
	CPoint m_def ;
	CPoint m_center;

	COLORREF m_color ;

	BOOL m_EXtended ;
	BOOL m_MoveFlag ;
	BOOL m_bDown ;

	int m_nLineDot ;
	int m_nLindTick ;

	void SetMoveFlag(BOOL moveflag) ;
	void SetProcess(int num) ;
	void SetMouseCursor() ;

	int PtInRect(CPoint point) ;

public :
	int m_bSet ;
	int m_nChoNum ;
	int m_row, m_col ;

	CRect m_rectDirect[9] ;

	void MakeDirect() ;

	int GetProcess() ;
};

#endif